import requests

from Constances import UserAgent

# 豆瓣电影排行榜分类列表

url = "https://movie.douban.com/j/chart/top_list"

# 重新封装参数
param = {
    "type": "24",
    "interval_id": "100:90",
    "action": "",
    "start": 0,
    "limit": 20
}

header = {
    "User-Agent": UserAgent
}

resp = requests.get(url=url, params=param, headers=header)

print(resp.request.headers)
print(resp.url)
# 页面源代码
print(resp.json())
resp.close()